// (c) Copyright 2013 Mike Riedel.
// This source is subject to the Microsoft Public License (Ms-PL).
// All other rights reserved.

using System;

namespace FreshMeat.ErrorHandlingBlock
{
   /// <summary>
   /// Determines whether an error fits a category and diagnoses the error.
   /// </summary>
   public interface IErrorDetector
   {
      /// <summary>
      /// Determines whether the error fits this category.
      /// </summary>
      /// <param name="error">The error.</param>
      /// <returns>True if it fits this category.</returns>
      bool IsRelevant(Exception error);

      /// <summary>
      /// Diagnoses the error.
      /// </summary>
      /// <param name="error">The error.</param>
      /// <returns>The passed-in instance if sufficient or a new exception that
      /// better describes or classifies the error.</returns>
      Exception Diagnose(Exception error);
   }
}